package com.wlyuan.open.scanner.application.factory;

import com.wlyuan.open.OpenBaseSyncDTO;
import com.wlyuan.open.scanner.facade.SyncFacade;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author lijing
 * @description
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SyncFactory {
    private final SyncFacade syncFacade;

    /**
     * 同步
     *
     * @param source
     */
    public void sync(OpenBaseSyncDTO source) {
        if (source == null) {
            logger.warn("同步数据不存在");
            return;
        }
        syncFacade.sync(source);
    }


    public void syncRef(OpenBaseSyncDTO source) {
        if (source == null) {
            logger.info("同步数据不存在");
            return;
        }
        syncFacade.syncRef(source);
    }
}
